package com.lagou.subjectthree;

import java.math.BigDecimal;


public class SubjectThreeMain {
    public static void main(String[] args) {
        //创建通话套餐
        Combo callCombo = new CallCombo(BigDecimal.valueOf(18.0), 100, 50);
        callCombo.ShowComboInfo();
        //创建流量套餐
        Combo internetCombo = new InternetCombo(BigDecimal.valueOf(18.0), 1024);
        internetCombo.ShowComboInfo();
        //创建手机卡
        PhoneCard phoneCard = new PhoneCard(CarTypeEnum.BigCard, 1001, "沈曹波", "123456", BigDecimal.valueOf(100), 100, 1024);
        phoneCard.ShowPhoneCardInfo();

        //打电话
        if (callCombo instanceof CallCombo)
            ((CallCombo) callCombo).MakePhone(phoneCard, 20);

        //上网
        if (internetCombo instanceof InternetCombo)
            ((InternetCombo) internetCombo).MakeInternet(phoneCard, 20);

        //卡剩余信息
        phoneCard.ShowPhoneCardInfo();
    }
}
